import http from 'utilMethods/http'

const request = 'http://report.wsn2019.club/project'

const tags = {
  ///project/add 发布一个任务
  postAddTask (params) {
    return http.post(`${request}/add`,params)
  },

  ///project/add/executors 添加任务执行人
  postAddTaskExecutor (params) {
    return http.post(`${request}/add/executors`,params)
  },
  // /project/add/goal 添加阶段性目标
  postAddTaskGoal (params) {
    return http.post(`${request}/add/goal`,params)
  },
  // /project/delete/{projectId} 删除一个任务
  postDeleteTaskGoal (projectId) {
    return http.post(`${request}/delete/`+projectId)
  },
  // /project/delete/executors 移除任务执行人
  getDeleteTaskExecutor (params) {
    return http.get(`${request}/delete/`,params)
  },
  // /project/getMember 选择负责人/执行人(从自己所加的群里面选择)
  getTaskExecutorMember () {
    return http.get(`${request}/getMember`)
  },
  ///project/getAll/{userId} 查看某人所参加的所有任务
  postAllEnteredTask (userId) {
    return http.post(`${request}/getAll/`+userId)
  },
  // /project/getGoal/{projectId} 查看某个任务的阶段性目标
  postAllGoalOfOneTask(projectId) {
    return http.post(`${request}/getGoal/`+ projectId)
  },
  // /project/add/goal 添加阶段性目标
  postAddGoal(params) {
    return http.post(`${request}/add/goal`,params)
  },
  // /project/get/{projectId} 查看某个任务
  postGetOneTask(projectId) {
    return http.post(`${request}/get/`+projectId)
  },
  ///project/delete/goal/{goalId} 删除阶段性目标
  getDeleteGoal(goalId) {
    return http.get(`${request}/delete/goal/`+goalId)
  },
  // /project/update/goal 修改阶段性目标
  postModifyGoal(params) {
    return http.post(`${request}/update/goal`,params)
  },
  // /project/delete/{projectId} 删除一个任务
  postDeleteTask(projectId) {
    return http.post(`${request}/delete/`+projectId)
  },
  // /project/getAllTag 查看某人所参加的所有任务标签
  postGetAllTag() {
    return http.post(`${request}/getAllTag`)
  },
  // /project/getProgress/{projectId} 获取当前用户某个任务的最新的进度
  getProgress(projectId) {
    return http.get(`${request}/getProgress/`+projectId)
  },
}

export default tags
